IF ~OPEN('Cfg',MM.PathCfg'MM_AddQuote.cfg','R') THEN DO ; SAY '*** Error: Can not open config "'MM.PAthCfg'MM_AddQuote.cfg"' ; EXIT 10 ;END
DO WHILE ~EOF('Cfg') ; Linea = READLN('Cfg') ; IF (LEFT(Linea,1) ~= ';') & Linea ~= '' THEN DO ; PARSE VAR Linea Keyword Dato ; Dato = STRIP(Dato) ; SELECT ; WHEN UPPER(Keyword) = '#EXTERNAL' THEN DO ; Cont = MM.External.Count ; MM.External.Cont = STRIP(Dato) ; MM.External.Count = Cont + 1 ; END ; WHEN UPPER(Keyword) = '#AREA' THEN MM.Aree = MM.Aree UPPER(STRIP(Dato)) ; WHEN UPPER(Keyword) = '#EDITOR' THEN MM.Editor = Trasforma(UPPER(STRIP(Dato))) ; OTHERWISE NOP ; END ; END ; END ; CLOSE('Cfg') ; RETURN
Replace: PROCEDURE ; PARSE ARG String, New, Old ; DO WHILE INDEX(String, Old) ~= 0 ; INTERPRET "PARSE VAR String l '"Old"' r" ; String = l || New || r ; END ; RETURN String